package com.simple.rpc.model;

import java.io.Serializable;
import java.util.Arrays;

/**
 * 服务的源数据
 *
 * @author mhh
 * @since 2020/9/17
 */
public class ServiceInvokeMetaData implements Serializable {

    /**
     * 调用服务/发布服务的全类名
     */
    private String className;

    /**
     * 调用服务/发布服务的方法名
     */
    private String methodName;

    /**
     * 方法执行所需的参数类型
     */
    private Class<?>[] paramTypes;

    /**
     * 方法执行的具体参数
     */
    private Object[] params;

    public ServiceInvokeMetaData(String className, String methodName, Class<?>[] paramTypes, Object[] params) {
        this.className = className;
        this.methodName = methodName;
        this.paramTypes = paramTypes;
        this.params = params;
    }

    @Override
    public String toString() {
        return "ServiceMetadata{" +
                "className='" + className + '\'' +
                ", methodName='" + methodName + '\'' +
                ", paramTypes=" + Arrays.toString(paramTypes) +
                ", params=" + Arrays.toString(params) +
                '}';
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public Class<?>[] getParamTypes() {
        return paramTypes;
    }

    public void setParamTypes(Class<?>[] paramTypes) {
        this.paramTypes = paramTypes;
    }

    public Object[] getParams() {
        return params;
    }

    public void setParams(Object[] params) {
        this.params = params;
    }
}
